<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.js"></script>
</head>

<body>
    <div id="app">
        <button @click="handleShow">按钮</button>
        <p v-show="isShow">今天天气真好</p>
        <h2 v-show="count === 1">Angular</h2>
        <h2 v-show="count === 2">React</h2>
        <h2 v-show="count === 3">Vue</h2>
        <h2 v-show="count >= 4">未知</h2>
    </div>
    <script>
        // 定义名为 tode-item的新组建
        Vue.component("todo-item",{
            template:"<li>{{todo.text}}</li>"
        })

        const vm = new Vue({
            el:"#app",
            data: {
                isShow: true,
                count: 0
            },
            methods:{
                handleShow(){
                    this.count++;
                    this.isShow = !this.isShow;
                }
            }
        })
    </script>
</body>

</html>